package ye.guo.huang.datatransferdemo.model;

import lombok.Data;
import lombok.ToString;
import org.apache.commons.lang.StringUtils;

import java.io.Serializable;

@Data
@ToString
public class RequestData implements Serializable {

    private String appid;
    private Long timestamp;

    private String sign;
    private String data;

    private String param;

    public String sortData(String secret) {
        StringBuffer stringBuffer = new StringBuffer();
        stringBuffer.append(this.appid);
        stringBuffer.append(this.timestamp);
        if (StringUtils.isNotEmpty(this.data)) {
            stringBuffer.append(this.data);
        }

        stringBuffer.append(secret);
        return stringBuffer.toString();
    }

}
